﻿namespace RailEurope.Cockpit
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Collections.Specialized;

    public partial class ContactUsEnquiryReplyEmail : BaseEmailControl, IEmailTemplate
    {
        public string CustomerName { get; set; }
        public string EnquiryId { get; set; }
        public string ThreadContent { get; set; }
        public string UserName { get; set; }
        public string TimeAdded { get; set; }
        public string ViewEnquiryURL { get; set; }
        public string EmailSignature { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #region IEmailTemplate Members

        public void SetProperty(object entity)
        {
            if (entity is EnquiryThread)
                SetControlProperty(entity as EnquiryThread);
            else
                SetControlProperty(entity as NameValueCollection);
        }
        public void SetControlProperty(EnquiryThread th)
        {
            CustomerName = th.CustomerName;
            EnquiryId = th.EnquiryId;
            ThreadContent = th.ThreadContent;
            UserName = th.UserName;
            TimeAdded = th.TimeAdded;
            ViewEnquiryURL = th.ViewEnquiryURL;
            EmailSignature = th.EmailSignature;
        }

        public void SetControlProperty(NameValueCollection th)
        {
            CustomerName = th["CustomerName"];
            EnquiryId = th["EnquiryId"];
            ThreadContent = th["ThreadContent"];
            UserName = th["UserName"];
            TimeAdded = th["TimeAdded"];
            ViewEnquiryURL = th["ViewEnquiryURL"];
            EmailSignature = th["EmailSignature"];
        }

        #endregion
    }


}